library TeamRosterCommand initializer init requires LegacySystem

	private function TeamRosterCommand takes nothing returns nothing
		local integer i = 1
		local player p = GetTriggerPlayer()
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, " " )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "|cfff3ad00Active Marines - 3rd Platoon, Echo Company|r" )
		loop
			exitwhen i>udg_Players
			if udg_Hero[udg_Sorted[i]]==null then
				call DisplayTimedTextToPlayer( p, 0, 0, 20.0, udg_Pcolors[udg_Sorted[i]] + GetPlayerName(ConvertedPlayer(udg_Sorted[i])) + "|r - |cff696969Selecting|r" )
			else
				call DisplayTimedTextToPlayer( p, 0, 0, 20.0, udg_Pcolors[udg_Sorted[i]] + GetPlayerName(ConvertedPlayer(udg_Sorted[i])) + "|r - " + GetUnitName(udg_Hero[udg_Sorted[i]]) )
			endif
			set i=i+1
		endloop
		call DisplayTimedTextToPlayer( p, 0.0, 0.0, 20.0, " " )
		call DisplayTimedTextToPlayer( p, 0.0, 0.0, 20.0, " " )
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		local integer i = 0
		set t = CreateTrigger()

		loop
			exitwhen i > 11
			call TriggerRegisterPlayerChatEvent(t, Player(i), "-team", true)
			set i = i + 1
		endloop

		call TriggerAddAction(t,function TeamRosterCommand)
	endfunction
endlibrary